<include file="public:header" />
<!--菜单添加-->
<ul id="mytab" class="nav nav-tabs" style="margin-top: 15px;">
    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
    <li class="active"><a href="#con1" data-toggle="tab">IP黑名单</a></li>
    <!--<li><a href="#con2" data-toggle="tab">菜单添加1</a></li>-->
</ul>
<div id="tabContent" class="tab-content">
    <div class="tab-pane fade in active" id="con1">
        <div style="margin-top: 20px;">
            <form class="form-horizontal" role="form" action="{:u('superadmin/settings/blackip')}" method="post">

                <div class="form-group">
                    <label class="col-sm-1 control-label label-form">禁止IP:</label>
                    <div class="col-sm-3 input-padding">
                        <textarea class="form-control" id="ip" name="ip" rows="15"  placeholder="请输入禁止IP，多个用,隔开">{$black_list}</textarea>
                    </div>
                </div>


                <div class="form-group">
                    <button id="save" class="btn btn-primary btn-position">保存</button>
                </div>

            </form>

        </div>
    </div>
    <!--<div class="tab-pane fade" id="con2">-->
    <!--code-->
    <!--</div>-->
</div>


<include file="public:footer" />
<script>
    $(document).ready(function(){
        $('#mytab a').click(function (e) {
            e.preventDefault()
            $(this).tab('show')
        })

        $('#save').click(function(){
            //数据验证
            $.ajax({
                type: "POST",
                url: $('.form-horizontal').attr('action'),
                data: $('.form-horizontal').serialize(),
                dataType: "json",
                success:function(data){
                    if(data.status)
                    {
                        layer.msg(data.msg,{icon: 1,time:2000, shade: [0.1, '#ccc']});
                    } else {
                        layer.msg(data.msg,{icon: 2,time:2000, shade: [0.1, '#ccc']})
                    }
                }
            });
            return false;
        });



    });
</script>
</body>
</html>